<!-- 主页设计 -->
{% extends "base.html" %}
{% block title %}知识与你分享{% endblock %}
{% block content %}
{% load static %}
<script>
    function dianzan() {
        swal("对不起，请进入详情页进行 [点赞👍]", {
          icon: "warning",
          buttons: "好哒！",
        });
    };
    function pinglun() {
        swal("对不起，请进入详情页进行 [评论🎉]", {
          icon: "warning",
          buttons: "好哒！",
        });
    };
</script>
<div class="widgets-personal-info-area" style="margin-top: 20px">
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-4">
                <div class="personal-info-wrap shadow-reset">
                    <div class="widget-head-info-box">
                        <div class="persoanl-widget-hd">
                            <h2>最热文章 <i><u>HOT</u></i></h2>
                            <p>《{{ post.title }}》</p>
                        </div>
                        <img src="{{ post.picture }}" width="150" class="img-circle circle-border m-b-md" alt="profile">
                        <div class="social-widget-result" style="margin-top: 10px">
                            <span>热点人物：{{ post.people }}</span> |
                            <span>{{ post.keyword }}</span> |
                            <span>发布时间: {{ post.pub_date | date:'Y年m月d日'}}</span>
                        </div>
                    </div>
                    <div class="widget-text-box">
                    <h4><a href="/post/{{ post.id }}">{{ post.title }}</a></h4>
                    {% if post.body|length > 20 %}
				        <p>{{ post.body | truncatechars:80 }}...</p>
                    {% else %}
                        <p>{{ post.body | truncatechars:80 }}<p>
                    {% endif %}
                        <div align="right">
                            <button class="btn btn-white btn-xs" onclick="dianzan()"><i class="fa fa-thumbs-up"></i> 点赞数 ({{ post.likes }})</button>
                            <button class="btn btn-white btn-xs" onclick="pinglun()"><i class="fa fa-comments"></i> 评论数 ({{ comment }})</button>
                            <button class="btn btn-white btn-xs" onclick="javascrtpt:window.location.href='/post/{{ post.id }}'"><i class="fa big-icon fa-envelope"></i> 查看文章</button>
                        </div>
                    </div>
                </div>
            </div>
        {% if username != "" %}
            <div class="col-lg-4">
                <div class="weather-widget-wrap widget-ov-mg-t-30 widget-ov-mg-t-n-30 widget-ov-mg-t-l-30 shadow-reset">
                    <div class="row" align="center" style="font-family:'华文行楷'">
                                <h3>
    {% if hour >= 23 %}
         午夜时刻,
    {% elif hour >= 18 %}
         夜间降临,
    {% elif hour >= 17 %}
         夕阳美霞,
    {% elif hour >= 14 %}
         午后时刻,
    {% elif hour >= 11 %}
         午时已到,
    {% elif hour >= 8 %}
         上午好,
    {% elif hour >= 6 %}
         早晨好,
    {% elif hour >= 4 %}
         拂晓时刻,
    {% elif hour >= 0 %}
         凌晨时刻,
    {% endif %}
                                    欢迎 {{ username }} 的到来！</h3><br><br>
                            <div class="contact-client-img">
                                <img id="avatarimg" src="{% static userinfo.profile.avatar.url %}" width="120" alt="">
                            </div>
                    <div class="widget-text-box" style="margin-top: 25px;margin-left:-10px;background-color:rgba(250,250,250,0.5);width: 105%;font-family: 楷体">
                            <div class="contact-client-content">
                                <h1><a href="/userinfo/">༺ཌ {{ userinfo.username }} ད༻</a></h1>
                            </div>
                            <div class="contact-client-address">
                                <h3><strong>❀ 性别: </strong>{{ userprofileinfo.male | yesno:"男,女" }} ❀</h3>
                                <h3 class="address-client-ct"><strong>我的电子邮件：</strong>{{ userinfo.email }}</h3>
                                <h3><strong>最近登录：</strong>{{ userinfo.last_login }}</h3><br>
                            </div>
                    </div>
                    </div>
                </div>
            </div>
        {% else %}
        <div class="col-lg-4">
                <div class="weather-widget-wrap widget-ov-mg-t-30 widget-ov-mg-t-n-30 widget-ov-mg-t-l-30 shadow-reset">
                    <div class="row" align="center" style="font-family:'华文行楷'">
                    <div class="widget-text-box" style="margin-top: -20px;margin-left:-10px;background-color:rgba(250,250,250,0.1);width: 105%;font-family: 楷体">
                            <div class="contact-client-content">
                                 <h3>
    {% if hour >= 18 %}
         晚上好,
    {% elif hour >= 14 %}
         下午好,
    {% elif hour >= 11 %}
         中午好,
    {% elif hour >= 8 %}
         上午好,
    {% elif hour >= 4 %}
         早晨好,
    {% elif hour >= 0 %}
         凌晨好,
    {% endif %}
                                     知识与你分享！</h3><br>
                                <a href="/login/"><img src="/static/img/message/1.png" alt=""><br><br>
                                <img src="/static/img/logo/log.png" alt=""></a><br><br>
                                <button class="btn btn-info" onclick="javascrtpt:window.location.href='/login/'">点击登录</button><br><hr>
                            </div>
                            <div class="contact-client-address" style="font-family: 'Adobe 黑体 Std R'">
                                <h3 style="color: blueviolet">登录后享有文章专区查看、点赞、评论、收藏等功能</h3>
                            </div>
                    </div>
                    </div>
                </div>
            </div>
        {% endif %}
<div class="widgets-personal-info-area">
    <div class="container-fluid">
        <div class="row">
            <div class="col-lg-4">
                <div class="personal-info-wrap shadow-reset">
                    <div class="widget-head-info-box">
                        <div class="persoanl-widget-hd">
                            <h2>最新文章 <i><u>NEW</u></i></h2>
                            <p>《{{ new.title }}》</p>
                        </div>
                        <img src="{{ new.picture }}" width="150" class="img-circle circle-border m-b-md" alt="profile">
                        <div class="social-widget-result" style="margin-top: 10px">
                            <span>关键人物：{{ new.people }}</span> |
                            <span>{{ new.keyword }}</span> |
                            <span>发布时间: {{ new.pub_date | date:'Y年m月d日'}}</span>
                        </div>
                    </div>
                    <div class="widget-text-box">
                    <h4><a href="/post/{{ new.id }}">{{ new.title }}</a></h4>
                    {% if new.body|length > 20 %}
				        <p>{{ new.body | truncatechars:80 }}...</p>
                    {% else %}
                        <p>{{ new.body | truncatechars:80 }}<p>
                    {% endif %}
                        <div align="right">
                            <button class="btn btn-white btn-xs" onclick="dianzan()"><i class="fa fa-thumbs-up"></i> 点赞数 ({{ new.likes }})</button>
                            <button class="btn btn-white btn-xs" onclick="pinglun()"><i class="fa fa-comments"></i> 评论数 ({{ newcom }})</button>
                            <button class="btn btn-white btn-xs" onclick="javascrtpt:window.location.href='/post/{{ new.id }}'"><i class="fa big-icon fa-envelope"></i> 查看文章</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div></div></div></div>
{% if username == "" %}
<footer>
   <div class="user-profile-wrap shadow-reset" style="background:rgba(2, 2, 2, 0.05);">
      <div class="row" style="margin-top: 20px">
         <div class="col-lg-3 col-md-6 col-12">
            <div class="footer_blog_section" style="text-align: center;margin-top: 20px">
               <img src="/static/img/message/1.png" alt="#" width="35%" />
               <p style="margin-top: 5px;">Collect me to get more useful information in RX-IT</p>
            </div>
         </div>
         <div class="col-lg-2 col-md-6 col-12">
            <div class="item">
               <h4 class="text-uppercase">友情链接</h4>
               <ul>
                  <li style="margin-top: 16px"><a href="https://www.baidu.com/">百度星球 (www.baidu.com)</a></li>
                  <li style="margin-top: 8px"><a href="https://www.sogou.com/">搜狗星球 (www.sogou.com)</a></li>
                  <li style="margin-top: 8px"><a href="https://www.google.cn/">谷歌星球 (www.google.cn)</a></li>
                  <li style="margin-top: 8px"><a href="https://cn.bing.com/">必应星球 (www.bing.com)</a></li>
                  <li style="margin-top: 8px"><a href="https://www.so.com/">  360 星球 (www.so.com)</a></li>
               </ul>
            </div>
         </div>
         <div class="col-lg-4 col-md-6 col-12">
            <div class="item" style="margin-left: 60px">
               <p><strong>广州大学松田学院分部:</strong></p>
               <p><img src="/static/img/location.png" alt="#" /> 广州大学松田学院</p>
            </div>
         </div>
          <div class="col-lg-3 col-md-6 col-12">
            <div class="item">
               <h4 class="text-uppercase">辅助星球</h4>
               <ul>
                  <li style="margin-top: 20px"><a href="#">帮助中心</a></li>
                  <li style="margin-top: 15px"><a href="#">加入合作</a></li>
                  <li style="margin-top: 15px"><a href="#">用户反馈</a></li>
                  <li style="margin-top: 15px" style="margin-top: 8px"><a href="/">返回主页</a></li>
               </ul>
            </div>
         </div>
      </div>
   <div class="copyright text-center" style="margin-left: -10%"><hr>
      <p>Copyright 广州大学松田学院 ©2023 版权所有·侵版必究<a href="/" target="_blank"> 广州大学松田学院</a></p>
   </div>
   </div>
</footer>
{% endif %}
{% endblock %}